<?php
   $arrayid=$_POST['arrayid'];;
   $id=$_GET['id'];
   
   $connect=mysql_connect("localhost","root","");
   mysql_select_db("news",$connect);
   
	if(isset($arrayid[0])){
		 foreach ($arrayid as $id){
           $sql="delete from mygroup where id=$id";
		   mysql_query($sql);
		   
		  $sql="delete from guanxi where gid='$id'";
		  mysql_query($sql);
		   
	    }
		
     }
	 
   if(isset($id)){
	   $sql="delete from mygroup where id=$id";
	   mysql_query($sql);
	   
	   //删除群下的用户 
	   $sql="delete from guanxi where gid='$id'";
	   mysql_query($sql);
	   
	   
   }
	echo "<script>location='select_group.php'</script>";
?>